package net.sk.china.platform.service.system;

import com.baomidou.mybatisplus.extension.service.IService;
import net.sk.china.common.model.system.SystemCity;
import net.sk.china.platform.request.system.SystemCitySearchRequest;
import net.sk.china.platform.response.system.SystemCityTreeResponse;

import java.util.List;

/**
 * SystemCityService 接口
 * +----------------------------------------------------------------------
 * // | Talk To [ 聊来改善地区金融服务环境，助力企业发展 ]
 * // +----------------------------------------------------------------------
 * // | Copyright (c) 2018-2024 聊来 All rights reserved.
 * // +----------------------------------------------------------------------
 * // | Licensed ( <a href="http://www.apache.org/licenses/LICENSE-2.0">apache</a> )
 * // +----------------------------------------------------------------------
 * // | @Author: 聊来 <18970881148@qq.com>
 * // +----------------------------------------------------------------------
 * // | DateTime: 2024/6/3 16:14
 * // +----------------------------------------------------------------------
 */
public interface SystemCityService extends IService<SystemCity> {

    /**
     * 分页城市列表
     * @param request 搜索条件
     * @return {@code Object}
     */
    Object getList(SystemCitySearchRequest request);

    /**
     * 修改状态
     * @param id 城市id
     * @param status 状态
     * @return {@code boolean}
     */
    boolean updateStatus(Integer id, Boolean status);

    /**
     * 修改城市
     * @param id 城市id
     * @param request 修改参数
     * @return {@code boolean}
     */
    Boolean update(Integer id, SystemCitySearchRequest request);

    /**
     * 获取城市树
     * @return {@code List<SystemCityTreeResponse>}
     */
    List<SystemCityTreeResponse> getListTree();

    /**
     * 获取所有城市cityId
     * @return {@code List<Integer>}
     */
    List<Integer> getCityIdList();

    /**
     * 根据城市ID获取城市详细数据
     * @param cityId 城市id
     * @return {@code SystemCity}
     */
    SystemCity getCityByCityId(Integer cityId);

    /**
     * 根据城市编码获取城市详细数据
     * @param areaCode 城市编码
     * @return {@code String}
     */
    String getCityByAreaCode(String areaCode);


    /**
     * 根据城市名称获取城市详细数据
     * @param cityName 城市名称
     * @return {@code SystemCity}
     */
    SystemCity getCityByCityName(String cityName);



    /**
     * 获取无限分类
     * @param allTree 城市树
     * @param parentId 上级ID
     * @return {@code List<SystemCity>}
     */
    List<Integer> getChildListToCityIds(List<SystemCity> allTree, Integer parentId);
    List<SystemCity> allTree();
}
